package com.woniuxy.boot.common.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Document(indexName = "esuser")
public class EsUser implements Serializable {
    @Id
    private Long id;
    /**
     * 用户姓名
     */
    @Field(type = FieldType.Text , value = "carNumber")
    private String name;//用户名称
    /**
     * 用户邮件
     */
    @Field(type = FieldType.Text , value = "carNumber")
    private String email;//用户邮件
    /**
     * 用户电话
     */
    @Field(type = FieldType.Text , value = "carNumber")
    private String phone;//联系电话
    /**
     * 用户身份证ID
     */
    @Field(type = FieldType.Integer , value = "carNumber")
    private Integer idCardId;//身份证
    /**
     * 用户身份证号
     */
    @Field(type = FieldType.Text, value = "carNumber")
    private String idCard;
    /**
     * 用户性别
     */
    @Field(type = FieldType.Text , value = "carNumber")
    private String gender;//性别
    /**
     * 用户注册时间
     */
    @Field(type = FieldType.Date , value = "registerTime",format = {},pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd'T'HH:mm:ss'+08:00' || strict_date_optional_time || epoch_millis")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime registerTime;//注册时间
    /**
     * 用户状态
     */
    @Field(type = FieldType.Text , value = "carNumber")
    private String status;//状态
    /**
     * 绑定汽车数量
     */
    @Field(type = FieldType.Integer , value = "carNumber")
    private Integer carNum;

    /**
     * 是否购买
     */
    @Field(type = FieldType.Text , value = "carNumber")
    private String isBuy;
    /**
     * 保单数
     */
    @Field(type = FieldType.Long , value = "carNumber")
    private Long policyNum;
}
